local qianlve = fk.CreateSkill {
  name = "lvshi__qianlve",
  tags = {"Round"}
}

Fk:loadTranslationTable{
  ["lvshi__qianlve"] = "箝略",
  [":lvshi__qianlve"] = "轮次技，非己方角色成为【桃】的目标后，你可令之无效，若使用者不为其，重置此技能。",
  ["#ls__qianlve-invoke"] = "箝略：你可令%arg对%dest无效",

  ["$lvshi__qianlve1"] = "吾之所好，杀人诛心。",
  ["$lvshi__qianlve2"] = "汝可遣使相问，四下可有援军？",
}

local ls = require "packages/lvshi/utility"

qianlve:addEffect(fk.TargetConfirmed,{
  anim_type = "drawcard",
  can_trigger = function(self, event, target, player, data)
    return player:hasSkill(qianlve.name) and data.card.trueName == "peach" and not ls.isFriend(player, target)
    and player:usedSkillTimes(qianlve.name, Player.HistoryRound) == 0
  end,
  on_cost = function(self, event, target, player, data)
    return player.room:askToSkillInvoke(player, { skill_name = qianlve.name,
    prompt = "#ls__qianlve-invoke::"..target.id..":"..data.card:toLogString()})
  end,
  on_use = function(self, event, target, player, data)
    data.use.nullifiedTargets = data.use.nullifiedTargets or {}
    table.insertIfNeed(data.use.nullifiedTargets, target)
    if data.from ~= target then
      player:setSkillUseHistory(qianlve.name, 0, Player.HistoryRound)
    end
  end,
})


return qianlve